package com.chb.test.useThread_01;

public class ThreadDemo extends Thread{
    public static void main(String[] args) {
        /*
           多线程的第一种启动方式
              1：定义一个类继承Thread
              2：重写run方法
              3：创建子类对象，并启动线程
        */
        MyThread thread1 = new MyThread();
        MyThread thread2 = new MyThread();
        thread1.setName("线1");
        thread2.setName("线2");
        thread1.start();
        thread2.start();
    }
}
